﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Caifu
{
	/// <summary>
	/// 基金算法。
	/// </summary>
	public class FundAlgorithm
	{
		/// <summary>
		/// 计算净增长率。
		/// </summary>
		/// <param name="unit">除息日单位净值</param>
		/// <param name="preUnit">除息前一日单位净值</param>
		/// <param name="dividend">分红值</param>
		/// <returns></returns>
		public static decimal CalculateGrowthRate(decimal unit, decimal preUnit, decimal dividend)
		{
			return (preUnit / (preUnit - dividend)) * unit / preUnit - 1;
		}
	}
}
